Integrand size = 41, antiderivative size = 143 \[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {2 a (A-B-C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 a (3 A+3 B+C) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 a (B+C) \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d} \]
[Out]
Time = 0.23 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4161, 4132, 3856, 2720, 4131, 2719} \[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {2 a (3 A+3 B+C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{3 d}+\frac {2 a (A-B-C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 a (B+C) \sin (c+d x) \sqrt {\sec (c+d x)}}{d}+\frac {2 a C \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x)}{3 d} \]
[In]
[Out]
Rule 2719
Rule 2720
Rule 3856
Rule 4131
Rule 4132
Rule 4161
Rubi steps \begin{align*} \text {integral}& = \frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2}{3} \int \frac {\frac {3 a A}{2}+\frac {1}{2} a (3 A+3 B+C) \sec (c+d x)+\frac {3}{2} a (B+C) \sec ^2(c+d x)}{\sqrt {\sec (c+d x)}} \, dx \\ & = \frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2}{3} \int \frac {\frac {3 a A}{2}+\frac {3}{2} a (B+C) \sec ^2(c+d x)}{\sqrt {\sec (c+d x)}} \, dx+\frac {1}{3} (a (3 A+3 B+C)) \int \sqrt {\sec (c+d x)} \, dx \\ & = \frac {2 a (B+C) \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+(a (A-B-C)) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx+\frac {1}{3} \left (a (3 A+3 B+C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 a (3 A+3 B+C) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 a (B+C) \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\left (a (A-B-C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx \\ & = \frac {2 a (A-B-C) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 a (3 A+3 B+C) \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 a (B+C) \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\frac {2 a C \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
Time = 2.84 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.45 \[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {a e^{-i d x} \sec ^{\frac {3}{2}}(c+d x) (\cos (d x)+i \sin (d x)) \left (3 i A-3 i B-3 i C+3 i A \cos (2 (c+d x))-3 i B \cos (2 (c+d x))-3 i C \cos (2 (c+d x))+2 (3 A+3 B+C) \cos ^{\frac {3}{2}}(c+d x) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )-i (A-B-C) \left (1+e^{2 i (c+d x)}\right )^{3/2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3}{4},\frac {7}{4},-e^{2 i (c+d x)}\right )+2 C \sin (c+d x)+3 B \sin (2 (c+d x))+3 C \sin (2 (c+d x))\right )}{3 d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(488\) vs. \(2(179)=358\).
Time = 3.88 (sec) , antiderivative size = 489, normalized size of antiderivative = 3.42
method | result | size |
default | \(-\frac {a \sqrt {-\left (-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (\frac {2 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}+\frac {2 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \left (\operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}+2 C \left (-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}{6 \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-\frac {1}{2}\right )^{2}}+\frac {\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{3 \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}\right )+\frac {4 \left (\frac {B}{2}+\frac {C}{2}\right ) \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) | \(489\) |
parts | \(-\frac {2 \left (a A +a B \right ) \sqrt {\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}-\frac {2 \left (a B +C a \right ) \left (-2 \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}-\frac {2 C a \left (-2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, \operatorname {EllipticF}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right ) \sqrt {\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}}{3 \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{\frac {3}{2}} \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) d}+\frac {2 a A \sqrt {\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticE}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) | \(677\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.10 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.43 \[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {-i \, \sqrt {2} {\left (3 \, A + 3 \, B + C\right )} a \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + i \, \sqrt {2} {\left (3 \, A + 3 \, B + C\right )} a \cos \left (d x + c\right ) {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 3 i \, \sqrt {2} {\left (A - B - C\right )} a \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 3 i \, \sqrt {2} {\left (A - B - C\right )} a \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + \frac {2 \, {\left (3 \, {\left (B + C\right )} a \cos \left (d x + c\right ) + C a\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{3 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=a \left (\int \frac {A}{\sqrt {\sec {\left (c + d x \right )}}}\, dx + \int A \sqrt {\sec {\left (c + d x \right )}}\, dx + \int B \sqrt {\sec {\left (c + d x \right )}}\, dx + \int B \sec ^{\frac {3}{2}}{\left (c + d x \right )}\, dx + \int C \sec ^{\frac {3}{2}}{\left (c + d x \right )}\, dx + \int C \sec ^{\frac {5}{2}}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
\[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\int { \frac {{\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}}{\sqrt {\sec \left (d x + c\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\int { \frac {{\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}}{\sqrt {\sec \left (d x + c\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\int \frac {\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {\frac {1}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]